﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.Kupon>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	צור קופון
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server"><script src="../../Scripts/tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
 <script type="text/javascript">
    

     tinyMCE.init({ theme: "advanced",
         mode: "exact",
         elements: "KuponText",
         plugins: "",
         theme_advanced_buttons1_add_before: "forecolor,backcolor,copy,paste,fontselect", 
         theme_advanced_toolbar_location: "top",
         theme_advanced_toolbar_align: "left",
         theme_advanced_more_colors: true,
         theme_advanced_styles: "NormalBold 1=firstBold;Normal 2=first;Normal 3=second;", 
         content_css: "/Content/tinymce.css"
     });

   
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>צור קופון</h2>

    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm(this.Model == null ? "CreateKupon" : "EditKupon", "Kupon", FormMethod.Post, new { enctype = "multipart/form-data" }))
       {
    %>
        <fieldset>
             <%
            if (Model != null)
            {
        %>
        <input type="hidden" name="id" value="<%= Model.KuponId %>" />
        <input type="hidden" name="publish" value="1" />
        <%
            }
        %>
            <legend>שדות:</legend>
            
            
            
            <div>
            <label>שם:</label>
                <%= Html.TextBoxFor(model => model.KuponName) %>
                <%= Html.ValidationMessageFor(model => model.KuponName) %>
            </div>
            <p>
            <label for="_region">
                אזור:</label>
            <%= Html.DropDownList("region", nelech.Views.Shared.Code.Utils.CreateRegeonListItems(this.Model == null ? null : new Nullable<int>(this.Model.KuponRegion.Value)))%>
        </p>
              <div>
            <label>תמונה:</label>
              
                  <%
           if (Model != null && !string.IsNullOrEmpty(Model.KuponImage))
                    {
                %>
                <img class="thumbs" src="<%= Model.KuponImage %>" />
                
                <a href="/Kupon/RemoveKuponImage/<%= Model.KuponId %>">מחק</a>
                <%
                    }
                    else
                    {
                %>
                <input type="file" name="KuponImage" size="40" />
                <%
                    } 
                %>
            </div>
            
              <div>
            <label>תיאור:</label>
                <%= Html.TextArea("KuponText", new { rows = "15", cols = "80", id = "KuponText" })%>
              
            </div>
            
            <p>
                <input type="submit" value="צור" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("חזרה לרשימה", "ListAdminKupon")%>
    </div>

</asp:Content>

